-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some linting to gaia #188
Conversation
- closes #187 Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, pending the comment on prealloc
lcd_test/helpers.go
Outdated
@@ -151,8 +151,7 @@ func defaultGenesis(config *tmcfg.Config, nValidators int, initAddrs []sdk.AccAd | |||
|
|||
// append any additional (non-proposing) validators | |||
var genTxs []auth.StdTx | |||
var genAccounts []authexported.GenesisAccount | |||
|
|||
genAccounts := make([]authexported.GenesisAccount, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't preallocate to 0, just add nolint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even better, you already know the size to allocate: len(initAddrs) + nValidators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(initAddrs) + nValidators
this seems to be causing most the tests in lcd_test to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you setting values in the array correctly? i.e. genAccounts[genAccsIdx] = genAccount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ @marbar3778
lcd_test/helpers.go
Outdated
@@ -151,8 +151,7 @@ func defaultGenesis(config *tmcfg.Config, nValidators int, initAddrs []sdk.AccAd | |||
|
|||
// append any additional (non-proposing) validators | |||
var genTxs []auth.StdTx | |||
var genAccounts []authexported.GenesisAccount | |||
|
|||
genAccounts := make([]authexported.GenesisAccount, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even better, you already know the size to allocate: len(initAddrs) + nValidators
Signed-off-by: Marko Baricevic marbar3778@yahoo.com
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added a relevant changelog entry to the
Unreleased
section inCHANGELOG.md
Reviewed
Files changed
in the github PR explorerFor Admin Use: